import request from "@/utils/request";

// 分页查询列表操作1
export function page(query) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/caseReturnService/queryCaseReturnList",
    method: "get",
    params: query
  });
}

export function saveCaseReturn(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/caseReturnService/saveCaseReturn",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

//保存或者修改
export function outReturnFile(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/caseReturnService/outReturnFile",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

//根据办件oid查询
export function queryCaseReturnByCaseOid(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/caseReturnService/queryCaseReturnByCaseOid?caseOid=" +
      caseOid,
    method: "get"
  });
}

//保存或者修改退件告知
export function saveOrUpdateInfrom(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/caseReturnService/saveCaseReturnInform",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}
// 办件材料查询
export function getOneMaterialInfo(caseOid) {
  return request({
    // url: process.env.VUE_APP_BJFW_ROUTE_PATH + '/qlCaseMaterialService/queryQlCaseMaterialByCaseOid?caseOid='+caseOid,
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseMaterialService/queryMaterialAttaListByCaseOid?caseOid=" +
      caseOid,
    method: "get"
  });
}

// 获取证件类型
export function getCertificateType(type) {
  return request({
    url:
      process.env.VUE_APP_BJFW_ROUTE_PATH +
      "/sysDictService/getSelectCertificateType?type=" +
      type,
    method: "get"
  });
}

//根据办件编号查询退件附件
export function getOneRetuenCaseByCaseNumber(caseNumber) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/caseReturnService/getOneRetuenCaseByCaseNumber?caseNumber=" +
      caseNumber,
    method: "get"
  });
}

// 附件上传
export function uploadCaseMaterialFile(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/case/caseAtta/uploadCaseMaterialFile",
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data: data
  });
}
